package com.soen6441.generics;
import java.util.Iterator;

class RecursiveBounds {
    static <T extends Comparable<T>> T max(Iterable<T> ts){
        Iterator<T> it = ts.iterator();

        if (! it.hasNext() )
            return null;

        T max = it.next();
        while ( it.hasNext() ){
            T next = it.next();
            if (0 > max.compareTo(next) )
                max  = next;
        }
        return max;
    }
}
